<?php

namespace app\user\controller;

class Index extends base
{
    public function _initialize()
    {
    }

    public function index()
    {
        $data['uid'] = $this->getLoginUser()->id;
        $supply['all'] = model('supply')->where($data)->count();
        $Purchase['all'] = model('Purchase')->where($data)->count();
        $jobapply['all'] = model('jobapply')->where($data)->count();

        $data['status'] = '1';
        $supply['y'] = model('supply')->where($data)->count();
        $Purchase['y'] = model('Purchase')->where($data)->count();
        $jobapply['y'] = model('jobapply')->where($data)->count();

        $data['status'] = '0';
        $supply['n'] = model('supply')->where($data)->count();
        $Purchase['n'] = model('Purchase')->where($data)->count();
        $jobapply['n'] = model('jobapply')->where($data)->count();

        $this->assign([
            'supply' => $supply,
            'Purchase' => $Purchase,
            'jobapply' => $jobapply,
        ]);
        return $this->fetch();
    }


}
